#include "card.h"

Card::Card(const QString & symbol, QObject *parent) :
  QObject(parent),
  m_symbol(symbol),
  m_state(CardStates::Closed)
{
}

const SymbolType & Card::symbol() const{
	return m_symbol;
}

CardStates::CardStatesEnum Card::state() const{
	return m_state;
}

void Card::setState(CardStates::CardStatesEnum newState){
	if(newState != m_state){
		m_state = newState;
		emit stateChange();
	}
}

bool Card::isOpen() const{
	return state() == CardStates::Opened;
}

bool Card::isClose() const{
	return state() == CardStates::Closed;
}

bool Card::isDelete() const{
	return state() == CardStates::Deleted;
}
